feat(content-uploader): Implement cancel all retry all handlers#4577
Conversation
WalkthroughThis PR extends the upload system with a new ChangesUpload cancel status and modernized retry flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b7bf9cc to
4acdc6a
Compare
jpan-box
left a comment
There was a problem hiding this comment.
great work and thank you for splitting up this feature into different pr, but there are some conventions that we really want to stick to, and also the naming modernized sticks out a lot to me.
4b36707 to
330c734
Compare
jpan-box
left a comment
There was a problem hiding this comment.
All addressed — thanks for the clean refactor commit. Naming, shared retry helper, VRT cleanup, and constant alignment all look good.
…enableModernizedUploads flag
…handlers - Restore typeof STATUS_* union, add STATUS_CANCELED to keep type/constant linked - Rename handleModernized* -> handleUploadsManager* for clarity - Extract retryUploadsManagerItem helper shared by RetryAll and per-item retry - Drop unreachable empty-cancelable guard in handleUploadsManagerCancelAll - Drop dead typeof api.cancel function check in markItemCanceled - Align item handlers to warn-and-return on missing key - Replace inline status strings with constants in tests - Remove modernized VRTs already covered by shared feature tests
843f559 to
7947462
Compare
jpan-box
left a comment
There was a problem hiding this comment.
Re-approving after rebase.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/elements/content-uploader/ContentUploader.tsx`:
- Around line 1188-1196: handleUploadsManagerCancelAll currently bulk-cancels
items then calls updateViewAndCollection, but the collection-status predicates
still treat canceled items as "in progress", leaving queues stuck in
VIEW_UPLOAD_IN_PROGRESS; update the collection-status derivation used by
updateViewAndCollection (and any helper like areAllItemsFinished) to treat
STATUS_CANCELED as a terminal/finished state (i.e., exclude STATUS_CANCELED from
in-progress checks and include it as finished for areAllItemsFinished), so after
markItemCanceled the view correctly transitions out of VIEW_UPLOAD_IN_PROGRESS.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9d2ac303-e95f-4d62-aadc-b179ebb574b0
⛔ Files ignored due to path filters (1)
i18n/en-US.propertiesis excluded by!i18n/**
📒 Files selected for processing (6)
src/common/types/upload.jssrc/constants.jssrc/elements/content-uploader/ContentUploader.tsxsrc/elements/content-uploader/__tests__/ContentUploader.test.jssrc/elements/content-uploader/utils/__tests__/mapToModernizedUploadItem.test.tssrc/elements/content-uploader/utils/mapToModernizedUploadItem.ts
These keys had no defineMessages source on this branch, so the CI i18n rebuild dropped them and failed the generated-files check.
Merge Queue Status
This pull request spent 13 minutes 8 seconds in the queue, including 12 minutes 23 seconds running CI. Required conditions to merge
|
Summary
handleModernizedCancelAllandhandleModernizedRetryAllwired to the panel'sonCancelAll / onRetryAll.handleModernizedItemActioninto dedicatedhandleModernizedItemCancel / handleModernizedItemRetryso each calls the right legacy callback (onClickCancel,onClickRetry/onClickResume) and respects status preconditions.markItemCanceledhelper: cancels viaapi.cancel(), sets status toSTATUS_CANCELED, firesonClickCancel. Shared by single-item and bulk cancel.STATUS_CANCELEDto constants and the 'canceled' status to theUploadStatus Flowunion; extendmapToModernizedUploadItemSTATUS_MAPwith the canceled entry so canceled rows surface in the modernized panel.UploadStatusfrom internal status constants — declare the union as string literals with a TODO to align withUploadItemStatusfrom@box/uploads-manageronce the 'inprogress' value is migrated to 'uploading'.2/5 PR in the queue:
Summary by CodeRabbit
Release Notes